package org.example.chengyu.entity;

public class YiXiang {


    private String en_shiyi =null;

    private String zh_shiyi = null;



    public void setEn_shiyi(String en_shiyi) {
        this.en_shiyi = en_shiyi;
    }

    public void setZh_shiyi(String zh_shiyi) {
        zh_shiyi = zh_shiyi.replaceAll("((中性|贬义|褒义)。)","<语体>$1</语体>");
        this.zh_shiyi = zh_shiyi;
    }


    public String toString(){
        StringBuilder sb = new StringBuilder();
        sb.append("<义项>");
        if(en_shiyi != null && !"".equals(en_shiyi)){
            sb.append("<英文释义>").append(en_shiyi).append("</英文释义>");
        }
        if(zh_shiyi != null && !"".equals(zh_shiyi)){
            sb.append("<中文释义>").append(zh_shiyi).append("</中文释义>");
        }

        sb.append("</义项>");
        return sb.toString();

    }


}
